home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / patches / symantec / rtlinc.exe / STRING.H < prev    next >
C/C++ Source or Header  |  1993-09-28  |  6KB  |  192 lines

  1. /*_ string.h   Sun Apr    2 1989     Modified by: Walter Bright */
  2. /* $Revision:   1.6  $ */
  3.  
  4. #ifndef __STRING_H
  5. #define __STRING_H    1
  6.  
  7. #if __cplusplus
  8. extern "C" {
  9. #endif
  10.  
  11. typedef unsigned size_t;
  12.  
  13. #ifndef NULL
  14. #if __COMPACT__ || __LARGE__ || __VCM__
  15. #define NULL 0L
  16. #else
  17. #define NULL 0
  18. #endif
  19. #endif
  20.  
  21. #ifdef __STDC__
  22. #define __CDECL
  23. #define __STDCALL
  24. #else
  25. #define __CDECL __cdecl
  26. #define __STDCALL __stdcall
  27. #endif
  28.  
  29. #if __OS2__ && __INTSIZE == 4
  30. #define __CLIB    __STDCALL
  31. #else
  32. #define __CLIB    __CDECL
  33. #endif
  34.  
  35. void *    __CLIB memcpy(void *,const void *,size_t);
  36. void *    __CLIB memmove(void *,const void *,size_t);
  37. char *    __CLIB strcpy(char *,const char *);
  38. char *    __CLIB _inline_strcpy(char *,const char *);
  39. char *    __CLIB strncpy(char *,const char *,size_t);
  40. char *    __CLIB strcat(char *,const char *);
  41. char *    __CLIB strncat(char *,const char *,size_t);
  42. int    __CLIB memcmp(const void *,const void *,size_t);
  43. int    __CLIB strcmp(const char *,const char *);
  44. int    __CLIB _inline_strcmp(const char *,const char *);
  45. int    __CLIB strcoll(const char *,const char *);
  46. int    __CLIB strncmp(const char *,const char *,size_t);
  47. size_t    __CLIB strxfrm(char *,const char *,size_t);
  48. void *    __CLIB memchr(const void *,int,size_t);
  49. char *    __CLIB strchr(const char *,int);
  50. size_t    __CLIB strcspn(const char *,const char *);
  51. char *    __CLIB strpbrk(const char *,const char *);
  52. char *    __CLIB strrchr(const char *,int);
  53. size_t    __CLIB strspn(const char *,const char *);
  54. char *    __CLIB strstr(const char *,const char *);
  55. char *    __CLIB strtok(char *,const char *);
  56. void *    __CLIB memset(void *,int,size_t);
  57. char *    __CLIB strerror(int);
  58. size_t    __CLIB strlen(const char *);
  59. size_t    __CLIB _inline_strlen(const char *);
  60.  
  61. #if !__STDC__                                       
  62. int  *    __CLIB _memintset(int *, int, size_t);
  63. int    __CLIB memicmp(const void *,const void *,size_t);
  64. void *  __CLIB memccpy(void *,const void *,int,unsigned int);
  65. char *    __CLIB stpcpy(char *,const char *);
  66. int    __CLIB stricmp(const char *,const char *);
  67. #define strcmpi stricmp
  68. #define _strcmpi stricmp
  69.  
  70. int    __CLIB strcmpl(const char *,const char *); /* obsolete */
  71. int    __CLIB strnicmp(const char *, const char *, size_t);
  72. char *    __CLIB strdup(const char *);
  73. char *    __CLIB strlwr(char *);
  74. char *    __CLIB strupr(char *);
  75. char *    __CLIB strnset(char *,int,size_t);
  76. char *    __CLIB strrev(char *);
  77. char *    __CLIB strset(char *,int);
  78. void    __CLIB swab(char *,char *,size_t);
  79. void    __CLIB movedata(unsigned short srcseg,unsigned srcoff,unsigned short destseg,unsigned destoff,size_t nbytes);
  80. extern int __CLIB sys_nerr;
  81. extern char * __CLIB sys_errlist[];
  82.  
  83. #define movmem(src,dest,len) ((void)memmove(dest,src,len))
  84. #define setmem(dest,len,chr) ((void)memset(dest,chr,len))
  85. #define strncmpi strnicmp
  86.  
  87. #if 0    /* removed, use strchr() instead */
  88. char *    __CLIB index(const char *,int);
  89. #endif
  90.  
  91. #if __INTSIZE == 2 && (__SMALL__ || __MEDIUM__ || __COMPACT__)
  92. void __far * __CLIB __far fmemcpy(void __far *,const void __far *,size_t);
  93. void __far * __CLIB __far fmemmove(void __far *,const void __far *,size_t);
  94. void __far * __CLIB __far fmemchr(const void __far *,int,size_t);
  95. int  __CLIB __far fmemcmp(const void __far *,const void __far *,size_t);
  96. int  __CLIB __far fmemicmp(const void __far *,const void __far *,size_t);
  97. void __far * __CLIB __far fmemccpy(void __far *,const void __far *,int,unsigned int);
  98. void __far * __CLIB __far fmemset(void __far *,int,size_t);
  99. char __far *__CLIB __far fstrcat(char __far *,const char __far*);
  100. #else
  101. #define fmemcpy    memcpy
  102. #define fmemmove    memmove
  103. #define fmemchr    memchr
  104. #define fmemcmp    memcmp
  105. #define fmemicmp     memicmp
  106. #define fmemccpy        memccpy
  107. #define fmemset    memset
  108. #define fstrcat    strcat
  109. #define _fstrchr    strchr
  110. #define _fstrcmp    strcmp
  111. #define _fstricmp    stricmp
  112. #define _fstrcpy    strcpy
  113. #define _fstrcspn    strcspn
  114. #define _fstrdup    strdup
  115. #define _fstrlen    strlen
  116. #define _fstrlwr    strlwr
  117. #define _fstrncat    strncat
  118. #define _fstrncmp    strncmp
  119. #define _fstrnicmp    strnicmp
  120. #define _fstrncpy    strncpy
  121. #define _fstrnset    strnset
  122. #define _fstrpbrk    strpbrk
  123. #define _fstrrchr    strrchr
  124. #define _fstrrev    strrev
  125. #define _fstrset    strset
  126. #define _fstrspn    strspn
  127. #define _fstrstr    strstr
  128. #define _fstrtok    strtok
  129. #define _fstrupr    strupr
  130. #endif
  131.  
  132. #define _movedata movedata
  133. #define _memicmp memicmp
  134. #define _memccpy memccpy
  135. #define _strdup strdup
  136. #define _strlwr strlwr
  137. #define _strnset strnset
  138. #define _strrev strrev
  139. #define _strset strset
  140. #define _strupr strupr
  141. #define _swab swab
  142. #define _fmemcpy fmemcpy
  143. #define _fmemcmp fmemcmp
  144. #define _fmemicmp fmemicmp
  145. #define _fmemccpy fmemccpy
  146. #define _fmemmove fmemmove
  147. #define _fmemchr fmemchr
  148. #define _fmemset fmemset
  149. #define _fstrcat fstrcat
  150. #define _nmemicmp nmemicmp
  151.  
  152. #endif
  153.  
  154. #define strcoll(s1,s2)  strcmp(s1,s2)
  155. #define strncmpl(s1,s2,n) strnicmp(s1,s2,n)
  156.  
  157. #define strcmp(x,y)    _inline_strcmp(x,y)
  158. #define strcpy(x,y)    _inline_strcpy(x,y)
  159. #define strlen(s)    _inline_strlen(s)
  160.  
  161. #if 1 /* some new compiler intrinsics added    */
  162.  
  163. void * __CLIB _inline_memcpy(void *,const void *,size_t);
  164. int    __CLIB _inline_memcmp(const void *,const void *,size_t);
  165. #define memcpy(s1,s2,n)    _inline_memcpy(s1,s2,n)
  166. #define memcmp(s1,s2,n)    _inline_memcmp(s1,s2,n)
  167.  
  168. char __far *    __CLIB _inline_fstrcpy(char __far *,const char __far *);
  169. int    __CLIB _inline_fstrcmp(const char __far *,const char __far *);
  170. size_t    __CLIB _inline_fstrlen(const char __far *);
  171. void __far * __CLIB _inline_fmemcpy(void __far *,const void __far *,size_t);
  172. int    __CLIB _inline_fmemcmp(const void __far *,const void __far *,size_t);
  173. #undef _fstrcpy
  174. #undef _fstrcmp
  175. #undef _fstrlen
  176. #undef _fmemcpy
  177. #undef _fmemcmp
  178. #define _fstrcpy(s1,s2)        _inline_fstrcpy(s1,s2)
  179. #define _fstrcmp(s1,s2)        _inline_fstrcmp(s1,s2)
  180. #define _fstrlen(s)        _inline_fstrlen(s)
  181. #define _fmemcpy(s1,s2,n)    _inline_fmemcpy(s1,s2,n)
  182. #define _fmemcmp(s1,s2,n)    _inline_fmemcmp(s1,s2,n)
  183.  
  184. #endif
  185.  
  186. #if __cplusplus
  187. }
  188. #endif
  189.  
  190. #endif /* __STRING_H */
  191.  
  192.